import http from '@/service/http'
import type * as T from '@/types/api/index'
const departmentApi: T.IDepartmentApi = {
  list(params) {
    return http.get('/admin/dept/tree', params)
  },
  detail(id) {
    return http.get(`/admin/dept/${id}`)
  },
  add(data) {
    return http.post('/admin/dept', data)
  },
  edit(data) {
    return http.put('/admin/dept', data)
  },
  del(data) {
    return http.delete(`/admin/dept/${data.ids[0]}`)
  },
}

export default departmentApi
